package com.rui.study.algorithm.L_深入拆解JVM_即时编译;

/**
 * @program: study
 * @description:
 * @author: Yaowr
 * @create: 2018-12-19 11:12
 **/
public class CompilationTest {

    public static int foo(boolean f, int in) {
        int v;
        if (f) {
            v = in;
        } else {
            v = (int) Math.sin(in);
        }

        if (v == in) {
            return 0;
        } else {
            return (int) Math.cos(v);
        }
    }

    public static void main(String[] args) throws Exception {
        for (int i = 1; i <= 500_000; i++) {
            foo(true, 2);
        }
        Thread.sleep(2000);
    }
}
